<?php
define('ADMIN_EXT',	  	  'dc/');
define('ROOT_PATH',       str_replace(ADMIN_EXT.'common', '', str_replace('\\', '/', __DIR__)));
define('ADMIN_PATH',      ROOT_PATH.ADMIN_EXT);
define('INCLUDE_PATH',    ROOT_PATH.'include/');
define('APP_PATH',        ADMIN_PATH.'action/');
define('COMMON_PATH',     ROOT_PATH.'common/');
define('DATA_PATH',       ROOT_PATH.'data/');

define('TEMPLATE_PATH',	  ADMIN_PATH.'template/');
define('TEMP_PATH',	  	  ROOT_PATH.'cache/admin/');
define('COMPILE_PATH',	  DATA_PATH.'compile/admin/');

//--开启session
session_start();

//--开启错误
ini_set('display_errors', true);
error_reporting(E_ALL);

include_once(DATA_PATH.'config.php');
include_once(COMMON_PATH.'db.class.php');
include_once(COMMON_PATH.'smarty.class.php');
include_once(INCLUDE_PATH.'base.class.php');
include_once(APP_PATH.'action.class.php');
include_once(COMMON_PATH.'function.php');

//--初始化
$GLOBALS['db'] = new db(D_HOST, D_USER, D_PASS, D_DATA);
$GLOBALS['smarty'] = new smarty();
$GLOBALS['smarty']->template_dir = TEMPLATE_PATH;
$GLOBALS['smarty']->cache_dir	 = TEMP_PATH;
$GLOBALS['smarty']->compile_dir	 = COMPILE_PATH;

$p = null;
?>